package com.foreveredu.furedusys.web.struts.action;

import org.apache.struts.actions.DispatchAction;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;

public abstract class AbstractBaseDispatchAction extends DispatchAction {

	protected UserDetails getPrincipal() {
		Authentication auth = SecurityContextHolder.getContext().getAuthentication();
		UserDetails userDetails = (UserDetails) auth.getPrincipal();
		
		return userDetails;
	}
	
}
